package day1126;

import java.util.Arrays;

public class demo4 {
    public static void main(String[] args) {
        int[] a={1,3,4,6,7};
        int num=3;
        for(int i=0;i<a.length;i++)
        {
            if(a[i]==num)
            {
                for(int j=i;j<a.length-1;j++)
                {

                    a[j]=a[j+1];
                }
            }
        }
        a= Arrays.copyOf(a,a.length-1);
        System.out.println(Arrays.toString(a));
    }
}
